<!DOCTYPE html>
<html lang="zh-cn">
<head>
    <meta charset="UTF-8">
    <title>lu_projectProgress 过程管理-人员管理</title>
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta name="renderer" content="webkit">
    <meta http-equiv="Cache-Control" content="no-siteapp" />

    <link href="ADMIN_PUBLIC/css/bootstrap.min.css" rel="stylesheet">
    <link href="ADMIN_PUBLIC/css/animate.min.css" rel="stylesheet">
    <link href="ADMIN_PUBLIC/css/style.min.css" rel="stylesheet">

    <link rel="stylesheet" href="ADMIN_PUBLIC/css/lu_common.css">
    <link rel="stylesheet" href="ADMIN_PUBLIC/css/lu_projectProgress.css">
    <link rel="stylesheet" href="ADMIN_PUBLIC/css/lu_projectProgress_people.css">
    <link rel="stylesheet" href="ADMIN_PUBLIC/fonts_style/iconfont.css">
    <style>
        /*.table_BOX:after{
            content:'';
            display: block;
            clear: both;
        }
        .projectProgress_table_BOX{
            margin-top: 30px;
        }
        .projectProgress_table_title {
            text-align: center;
            margin-bottom: 40px;
        }
        .hidden_box {
            position: absolute;
            top: -40px;
            left: 100px;
        }
        .operation_btn {
            position: absolute;
            right: 60px;
            top: -34px;
            display: flex;
            align-items: center;
        }*/
        .workTime_list{
            padding:15px;
        }
        .chooseDay{
            display: none;
        }
        .chooseDay.active{
            display: flex;
        }
        ul.chooseDayList{
            display: flex;
            flex-wrap: wrap;
            position: relative;
            /*height: 190px;*/
        }
        ul.chooseDayList>li{
            width: 30px;
            height: 30px;
            margin: 4px;
            color: #333;
            font-size: 12px;
            text-align: center;
            line-height: 30px;
            cursor: pointer;
        }
        ul.chooseDayList>li.active{
            background-color: #2881C1;
            color: #fff;
        }
        ul.chooseDayList .chooseDayBtn{
            color: #666;
            background-color: transparent;
            font-size: 12px;
            cursor: pointer;
            outline: none;
            height: 26px;
            line-height: 24px;
            margin: 0 0 0 -1px;
            padding: 0 10px;
            border: 1px solid #C9C9C9;
            white-space: nowrap;
            border-radius: 2px;
        }
        ul.chooseDayList .chooseDayBtn_box{
            display: block;
            position: relative;
            width: 100%;
            height: 26px;
        }
        ul.chooseDayList .chooseDayBtn_box>div{
            position: absolute;
            right: 10px;
            bottom: 0;
            display: flex;
        }
        
    </style>

</head>
<body class="color_fff container-fluid row" style="background-color: #fff">
    <include file = 'Common/pro_nav' />
    <div class="row projectProgress_table_BOX">
        <include file = 'Common/pro_base' />
        <div class="table_BOX">
            <table class="col-sm-12 table table-striped comTableStyle" id="table_table">
                <thead>
                <tr>
                    <th><input type="checkbox" id="checkAll" class="checkboxStyle"></th>
                    <th>时间</th>
                    <!-- <th>结束时间</th> -->
                    <th>姓名</th>
                    <th>部门</th>
                    <th>工时(h)</th>
                    <th>工时及工作记录</th>
                    <th>操作</th>
                </tr>
                </thead>
                <tbody>
            <volist name = 'data' id = 'v'>
                <tr data-index="{$v.id}">
                    <td><input type="checkbox" class="checkboxStyle" <if condition = "$v.is_cal == 1">disabled<else /></if>></td>
                    <td>{$v.start_time}</td>
                    <!-- <td>{$v.end_time}</td> -->
                    <td>{$v.staff_name}</td>
                    <td>{$v.dep_name}</td>
                    <td>{$v.work_hours}</td>
                    <td class="look_record">
                        <a href="#" class="look_record_btn">查看记录</a>
                        <div class="tip_hiddenBox work_record_box">
                            <span class="work_record_title">工时记录</span>
                            <!-- <p class="work_record_main">{$v.work_record}</p> -->
                            <ul style='text-align:left'>
                                <volist name='v.work_record' id='vo'>
                                    <!-- <li>
                                        <span data-day='{$vo.day}'>{$vo.date}</span>
                                        <input type="text" value='{$vo.record}'>
                                    </li> -->
                                    <li>{$vo.date} :  {$vo.record}</li>
                                </volist>
                            </ul>
                            <button class="btn btn-sm btn-success">确认</button>
                        </div>
                    </td>
                    <if condition  = '$v.is_cal == 0'>
                    <td><a href="edit_people" class="edit_table">编辑</a></td>
                    <else />
                    <td><a href="#" class="edit_table">取消核算</a></td>
                    </if>
                </tr>
            </volist>
                </tbody>
            </table>
            <div class="pagination"><ul><li>{$page}</li></ul></div>
            <div class="hidden_box">
                <div class="hidden_box_showBox ">
                    <span id="dateVal">筛选</span>
                    <i class="iconfont icon-jiantou"></i>
                </div>
                <ul class="hidden_box_hiddenBox">
                    <li class=" hidden_box_hiddenBox_list ">
                        <span class="hiddenBox_list_text">时间：</span>
                        <input type="text" class=" BFBFBF_inputStyle" id="query_year_people" data-query="time">
                    </li>
                    <li class=" hidden_box_hiddenBox_list ">
                        <span class="hiddenBox_list_text">姓名：</span>
                        <input type="text" class=" BFBFBF_inputStyle" data-query="name">
                    </li>
                    <li class="hiddenBox_list_btn">
                        <button class="btn btn-sm btn-success" id="query">确定</button>
                        <button class="btn btn-sm btn-success">查找全部</button>
                        <button class="btn btn-sm btn-default">取消</button>
                    </li>
                </ul>
            </div>
            <ul class="operation_btn">
                <li><a href="add_people" class="btn btn-success">添加</a></li>
                <!-- <li><a href="#import" class="btn btn-success">批量导入</a></li> -->
                <li><a href="#delete" class="btn btn-success">批量删除</a></li>
                <li><a href="#check" class="btn btn-success">核算</a></li>
            </ul>
            <ul class="animated fadeIn add_hiddenBox" lll="add_people" id='add_people'>
                <li class="form-group table_btn_list">
                    <label class="col-sm-3 table_btn_list_title"><i class="iconfont icon-asterisk table_btn_list_necessary"></i>选择年月：</label>
                    <div class="col-sm-9">
                        <input type="text" class="col-sm-9 BFBFBF_inputStyle add_people_input" placeholder="" id="start_time_add" add_name="start_time_add" autocomplete="off">
                    </div>
                </li>
                <li class="form-group table_btn_list ver_top chooseDay ">
                    <label class="col-sm-3 table_btn_list_title"><i class="iconfont icon-asterisk table_btn_list_necessary"></i>选择日期：</label>
                    <div class="col-sm-9">
                        <ul id='addList' class='chooseDayList'>
                            <!-- <li></li> -->
                        </ul>
                    </div>
                </li>
                <!-- <li class="form-group table_btn_list">
                    <label class="col-sm-3 table_btn_list_title"><i class="iconfont icon-asterisk table_btn_list_necessary"></i>结束时间：</label>
                    <div class="col-sm-9" id='end_time_add_box'>
                        <input type="text" class="col-sm-9 BFBFBF_inputStyle add_people_input" placeholder="" id="end_time_add" add_name="end_time_add">
                    </div>
                </li> -->
                <li class="form-group table_btn_list">
                    <label class="col-sm-3 table_btn_list_title"><i class="iconfont icon-asterisk table_btn_list_necessary"></i>姓名：</label>
                    <div class="col-sm-9">
                        <select class="form-control table_btn_list_selectStyle" add_name="add_name"></select>
                    </div>
                </li>
                <li class="form-group table_btn_list">
                    <label class="col-sm-3 control-label table_btn_list_title"><i class="iconfont icon-asterisk table_btn_list_necessary"></i>部门：</label>
                    <div class="col-sm-9">
                        <input type="text" class="col-sm-9 BFBFBF_inputStyle add_people_input" placeholder="" readonly add_name="add_department">
                    </div>
                </li>
                <!-- <li class="form-group table_btn_list ver_top">
                    <label class="col-sm-3 control-label table_btn_list_title"><i class="iconfont icon-asterisk table_btn_list_necessary"></i>选择工时记录：</label>
                    <div class="col-sm-9">
                        <input type="text" class=" BFBFBF_inputStyle add_people_input" id='add_choose_workTime' readonly>
                        <p style='color:#ff0000;font-size:14px;margin-top:8px'>注：不能跨月选择！</p>
                    </div>
                </li> -->

                <li class="form-group table_btn_list ver_top">
                    <label class="col-sm-3 table_btn_list_title"><i class="iconfont icon-asterisk table_btn_list_necessary"></i>工时(h)：</label>
                    <div class="col-sm-9">
                        <input type="number" class="BFBFBF_inputStyle add_people_input" placeholder="" add_name="add_workTime" readonly value='0'>
                        <!-- <p style='color:#ff0000;font-size:14px;margin-top:8px'>注：按照每天8小时标准计算</p> -->
                        <p style='color:#ff0000;font-size:14px;margin-top:8px'>注：按照每日标准工时计算</p>
                    </div>
                </li>

                <ul id='add_workTime_list' class='workTime_list'>
                    <!-- <li>
                        <span>2018-12-12:</span>
                        <input type="number" class="BFBFBF_inputStyle add_people_input">
                        <i class='iconfont icon-cha'></i>
                    </li> -->
                </ul>

                <li class="button_list">
                    <button class="btn btn-sm btn-success" id="add_btn">确认添加</button>
                    <button class="btn btn-sm btn-success" id="add_AddNew_btn">添加并新增</button>
                    <button class="btn btn-sm btn-default cancel_btn">取消</button>
                </li>
            </ul>
            <ul class="animated fadeIn add_hiddenBox" lll="edit_people" id='edit_people'>
                <li class="form-group table_btn_list">
                    <label class="col-sm-3 table_btn_list_title"><i class="iconfont icon-asterisk table_btn_list_necessary"></i>选择年月：</label>
                    <div class="col-sm-9">
                        <input type="text" class="col-sm-9 BFBFBF_inputStyle add_people_input" placeholder="" id="start_time_edit" add_name="start_time_edit" autocomplete="off">
                    </div>
                </li>
                <li class="form-group table_btn_list ver_top chooseDay active">
                    <label class="col-sm-3 table_btn_list_title"><i class="iconfont icon-asterisk table_btn_list_necessary"></i>选择日期：</label>
                    <div class="col-sm-9">
                        <ul id='editList' class='chooseDayList'>
                            <!-- <li></li> -->
                        </ul>
                    </div>
                </li>
                <!-- <li class="form-group table_btn_list">
                    <label class="col-sm-3 table_btn_list_title"><i class="iconfont icon-asterisk table_btn_list_necessary"></i>结束时间：</label>
                    <div class="col-sm-9">
                        <input type="text" class="col-sm-9 BFBFBF_inputStyle add_people_input" placeholder="" id="end_time_edit" add_name="end_time_edit">
                    </div>
                </li> -->
                <li class="form-group table_btn_list">
                    <label class="col-sm-3 table_btn_list_title"><i class="iconfont icon-asterisk table_btn_list_necessary"></i>姓名：</label>
                    <div class="col-sm-9">
                        <!--<input type="text" class="col-sm-9 BFBFBF_inputStyle add_people_input" placeholder="" add_name="edit_name">-->
                        <select class="form-control table_btn_list_selectStyle" add_name="edit_name">
                            <!--<option>技术部1</option>-->
                            <!--<option>技术部2</option>-->
                            <!--<option>技术部3</option>-->
                            <!--<option>技术部4</option>-->
                        </select>
                    </div>
                </li>
                <li class="form-group table_btn_list">
                    <label class="col-sm-3 control-label table_btn_list_title"><i class="iconfont icon-asterisk table_btn_list_necessary"></i>部门：</label>
                    <div class="col-sm-9">
                        <input type="text" class="col-sm-9 BFBFBF_inputStyle add_people_input" placeholder="" readonly add_name="edit_department">
                    </div>
                </li>
                <!-- <li class="form-group table_btn_list ver_top">
                    <label class="col-sm-3 control-label table_btn_list_title"><i class="iconfont icon-asterisk table_btn_list_necessary"></i>选择工时记录：</label>
                    <div class="col-sm-9">
                        <input type="text" class=" BFBFBF_inputStyle add_people_input" id='edit_choose_workTime' readonly>
                        <p style='color:#ff0000;font-size:14px;margin-top:8px'>注：不能跨月选择！</p>
                    </div>
                </li> -->

                <li class="form-group table_btn_list ver_top">
                    <label class="col-sm-3 table_btn_list_title"><i class="iconfont icon-asterisk table_btn_list_necessary"></i>工时(h)：</label>
                    <div class="col-sm-9">
                        <input type="number" class="BFBFBF_inputStyle add_people_input" placeholder="" add_name="edit_workTime" readonly value='0'>
                        <!-- <p style='color:#ff0000;font-size:14px;margin-top:8px'>注：按照每天8小时标准计算</p> -->
                        <p style='color:#ff0000;font-size:14px;margin-top:8px'>注：按照每日标准工时计算</p>
                    </div>
                </li>
                <ul id='edit_workTime_list' class='workTime_list'>
                    <!-- <li>
                        <span>2018-12-12:</span>
                        <input type="number" class="BFBFBF_inputStyle add_people_input">
                        <i class='iconfont icon-cha'></i>
                    </li> -->
                </ul>

                <li class="button_list">
                    <button class="btn btn-sm btn-success" id="save_btn">保存</button>
                    <button class="btn btn-sm btn-default cancel_btn">取消</button>
                </li>
            </ul>
        </div>

        <!--内容没填完，弹框-->
        <div class="warning_hiddenBox animated fadeIn" id="yz_modal" box="yz_modal">您有内容没有填写完哦！</div>

        <!--核算弹框-->
        <div class="tip_hiddenBox animated fadeIn" id="check" lll="check">
            <div class="check_main_box">
                <ul>
                    <li class="check_text_14_000">
                        <span>核算成功人数：</span>
                        <span>
                        <span class="check_success_num"></span>
                        <span>人</span>
                    </span>
                    </li>
                    <li class="check_text_14_000">
                        <span>核算失败人数：</span>
                        <span>
                        <span class="check_error_num"></span>
                        <span>人</span>
                    </span>
                    </li>
                </ul>
                <p class="check_error_Reason_text">
                    <span>核算失败原因:</span>
                    <span class="check_error_Reason">工资表内没有相应的核算数据！</span>
                </p>
            </div>
            <ul class="check_btn">
                <li><a href="{:U('Pay/index')}" class="btn btn-success toManage">去管理</a></li>
                <li><a href="#" class="btn btn-default cancel_btn">取消</a></li>
            </ul>
        </div>

        <!--删除人员-->
        <div class="add_hiddenBox animated fadeIn" id="delete" lll="delete">
            <p class="delete_tip_text">确认删除吗？</p>
            <div class="delete_tip_btn_box">
                <button class="btn btn-sm btn-success">确认</button>
                <button class="btn btn-sm btn-default">取消</button>
            </div>
        </div>
        <!--导入文件-->
        <div class="add_hiddenBox animated fadeIn" id="import" lll="import">
            <p class="import_tip_text">温馨提示：</p>
            <p class="import_tip_text">请下载统一的模版，并按相应的格式在Excel软件中填写您的业务数据，然后再导入到系统中。</p>
            <form action="/Admin/ProStaff/importStaff" method="post" enctype="multipart/form-data" id="file_form">
                <input type="file" accept="application/vnd.ms-excel,application/vnd.openxmlformats-officedocument.spreadsheetml.sheet" class="import_tip_text file_upload_btn" id="file_upload" name="staffs">
                <div class="import_tip_btn_box">
                    <a class="btn btn-sm btn-success" href="/Excel/tpl/过程管理员工批量导入模板.xls">下载模板</a>
                    <button class="btn btn-sm btn-grey">确定导入</button>
                </div>
            </form>
        </div>
    </div>

    <script src="ADMIN_PUBLIC/js/jquery.min.js"></script>
    <script src="ADMIN_PUBLIC/js/laydate/laydate.js"></script>
    <script src="ADMIN_PUBLIC/js/lu_projectProgress.js"></script>
    <script>
        $(function(){
            // let htmls = ''
            // for(let i=1; i<=31; i++){
            //     htmls+=`<li>${i}</li>`
            // }
            // $('#addList').html(htmls)

            let add_workTime_arr = []
            window.query_year_people=''
            // let mins , maxs , vals

            laydate.render({
                elem: '#query_year_people', //指定元素
                type:  'month',
                theme: '#2881C1',
                done: function(value, date, endDate){
                    let dateVal = date.year+'年'+date.month+'月'
                    window.query_year_people = dateVal
                }
            });

            /*添加时选择年月*/
            laydate.render({
                elem: '#start_time_add', //指定元素
                type:  'month',
                theme: '#2881C1',
                btns: ['now', 'confirm'],
                done: function(value, date, endDate){
                    // let val = value
                    let year = date.year
                    let mon = date.month
                    let maxDay = 0
                    let htmls = ''

                    if(mon==2){
                        if( (year % 4 == 0 && year % 100 != 0 ) || year % 400 == 0 ){
                            maxDay = 29
                        }else{
                            maxDay = 28
                        }
                    }else if(mon==1||mon==3||mon==5||mon==7||mon==8||mon==10||mon==12){
                        maxDay = 31
                    }else if(mon==4||mon==6||mon==9||mon==11){
                        maxDay = 30
                    }

                    $.ajax({
                        url:'/Admin/ProStaff/getHours',
                        type:'get',
                        data:{
                            time:value
                        },
                        success:function(data){
                            // console.log(data)
                            let work_hours = 8
                            if(data.code==1){
                                work_hours = data.work_hours
                            }

                            for(let i=1; i<=maxDay; i++){
                                htmls+=`<li data-hours=${work_hours||8}>${i}</li>`
                            }
                            htmls+=`
                                <div class='chooseDayBtn_box'>
                                    <div>
                                        <button class='chooseDayBtn'>清空</button>
                                        <button class='chooseDayBtn'>确认</button>
                                    </div>
                                </div>
                            `
                            $('#addList').attr('data-hours',work_hours||8)
                            $('#addList').html(htmls)
                            $('#add_people').find('li.chooseDay').addClass('active')
                            $('#addList').children('li').removeClass('active')

                        }
                    })
                    
                }
            })
            /*编辑时选择年月*/
            laydate.render({
                elem: '#start_time_edit', //指定元素
                type:  'month',
                theme: '#2881C1',
                btns: ['now', 'confirm'],
                done: function(value, date, endDate){
                    // let val = value
                    let year = date.year
                    let mon = date.month
                    let maxDay = 0
                    let htmls = ''

                    if(mon==2){
                        if( (year % 4 == 0 && year % 100 != 0 ) || year % 400 == 0 ){
                            maxDay = 29
                        }else{
                            maxDay = 28
                        }
                    }else if(mon==1||mon==3||mon==5||mon==7||mon==8||mon==10||mon==12){
                        maxDay = 31
                    }else if(mon==4||mon==6||mon==9||mon==11){
                        maxDay = 30
                    }

                    $.ajax({
                        url:'/Admin/ProStaff/getHours',
                        type:'get',
                        data:{
                            time:value
                        },
                        success:function(data){
                            // console.log(data)
                            let work_hours = 8
                            if(data.code==1){
                                work_hours = data.work_hours
                            }

                            for(let i=1; i<=maxDay; i++){
                                htmls+=`<li data-hours=${work_hours||8}>${i}</li>`
                            }
                            htmls+=`
                                <div class='chooseDayBtn_box'>
                                    <div>
                                        <button class='chooseDayBtn'>清空</button>
                                        <button class='chooseDayBtn'>确认</button>
                                    </div>
                                </div>
                            `
                            $('#editList').attr('data-hours',work_hours||8)
                            $('#editList').html(htmls)
                            $('#edit_people').find('li.chooseDay').addClass('active')
                            $('#editList').children('li').removeClass('active')

                        }
                    })
                    
                }
            })
            //选择时间
            // laydate.render({
            //     elem: '#start_time_add', //指定元素
            //     theme: '#2881C1',
            //     done: function(value, date, endDate){
                    // let val = value
                    // let year = date.year
                    // let mon = date.month
                    // let day = date.date
                    // let max = year+'-'+mon+'-'+laydate.getEndDate(mon, year)
                    // let max
                    // let min = year+'-'+mon+'-'+day
                    // if(mon<10){
                    //     mon='0'+mon
                    // }
                    // if(day<10){
                    //     day='0'+day
                    // }
                    // if( (year % 4 == 0 && year % 100 != 0 ) || year % 400 == 0 ){
                    //     if(mon==2){
                    //         max = year+'-'+mon+'-29'
                    //     }else if(mon==1||mon==3||mon==5||mon==7||mon==8||mon==10||mon==12){
                    //         max = year+'-'+mon+'-31'
                    //     }else if(mon==4||mon==6||mon==9||mon==11){
                    //         max = year+'-'+mon+'-30'
                    //     }
                    // }else{
                    //     console.log(mon,year)
                    //     if(mon==2){
                    //         max = year+'-'+mon+'-28'
                    //     }else if(mon==1||mon==3||mon==5||mon==7||mon==8||mon==10||mon==12){
                    //         max = year+'-'+mon+'-31'
                    //     }else if(mon==4||mon==6||mon==9||mon==11){
                    //         max = year+'-'+mon+'-30'
                    //     }
                    // }
                    // mins = min
                    // maxs = max
                    // vals = val
                    // console.log( laydate.getEndDate(mon, year) )
                    // $('#ens_time_add').removeAttr('readonly')
                    // $('#end_time_add').attr('id','')
                    // $('#add_people').find('[add_name="end_time_add"]').attr('id','end_time_add')
                    // $('#add_people').find('[add_name="end_time_add"]').removeAttr('readonly')
                    //选择工时
                    // let l = ''
                    // l = laydate.render({
                    //     elem: '#end_time_add', //指定元素
                    //     theme: '#2881C1',
                    //     min: min,
                    //     max: max,
                    //     value: val,
                    //     done: function(value, date, endDate){


                    //     },
                    //     change:function(value, date, endDate){

                            
                        // }
                    // })

            //     },
            //     change:function(value, date, endDate){
            //         $('#end_time_add').val('')
            //         // $('#end_time_add').attr('id','')
            //         // $('#ens_time_add').removeAttr('readonly','readonly')
            //         $('#add_workTime_list').html('')
            //         $('#add_people').find('[add_name="add_workTime"]').val('0')
                // }
            // });
// $('#end_time_add_box').click(function(){
//     // console.log(mins)
//     // console.log(maxs)
//     let l
//     if(mins&&maxs&&vals){
//         // $('#end_time_add_box').children().attr('id','end_time_add')
//        l = laydate.render({
//             elem: '#end_time_add', //指定元素
//             theme: '#2881C1',
//             min: mins,
//             max: maxs,
//             value: vals,
//             show: true,
//             closeStop: '#end_time_add_box',
//             showBottom: false,
//             done: function(value, date, endDate){
//                 // console.log(value)
//                 // $('#end_time_add').attr('id','')
//                 // mins = ''
//                 // maxs = ''
//                 // vals = ''
//             },
            // change:function(value, date, endDate){

                
            // }
        // })
    // }else{
        // l = ''
    // }
// })

/*
    定义两个空的变量存一下add和edit点击出来的值
*/

/*******/
// let add_dates = '', edit_dates = ''
// /*添加时*/
// laydate.render({
//     elem: '#start_time_add', //指定元素
//     theme: '#2881C1',
//     done: function(value, date, endDate){
//         // let val = value
//         // let year = date.year
//         // let mon = date.month
//         // let day = date.date
//         // console.log(date)
//         add_dates = date
//         // $('#end_time_add').removeAttr('disabled')
//         $('#add_workTime_list').html('')
//         $('#end_time_add').val('')
//         $('#add_people').find('[add_name="add_workTime"]').val('0')
//     },
//     change:function(value, date, endDate){
//         $('#add_workTime_list').html('')
//         $('#end_time_add').val('')
//         $('#add_people').find('[add_name="add_workTime"]').val('0')
//     }
// });

// laydate.render({
//     elem: '#end_time_add', //指定元素
//     theme: '#2881C1',
//     done: function(value, date, endDate){
//         if(add_dates!=''){
//             if(date.month!=add_dates.month){
//                 $('#yz_modal').html('不能选择其他月份！')
//                 $('#yz_modal').addClass('active')
//                 tipShow()
//                 $('#add_workTime_list').html('')
//                 $('#end_time_add').val('')
//                 $('#add_people').find('[add_name="add_workTime"]').val('0')
//             }else if(date.year!=add_dates.year){
//                 $('#yz_modal').html('不能跨年选择！')
//                 $('#yz_modal').addClass('active')
//                 tipShow()
//                 $('#add_workTime_list').html('')
//                 $('#end_time_add').val('')
//                 $('#add_people').find('[add_name="add_workTime"]').val('0')
//             }else{
//                 if(date.date<add_dates.date){
//                     $('#yz_modal').html('结束日期不能小于开始日期')
//                     $('#yz_modal').addClass('active')
//                     tipShow()
//                     $('#add_workTime_list').html('')
//                     $('#end_time_add').val('')
//                     $('#add_people').find('[add_name="add_workTime"]').val('0')
//                 }else{
//                     let htmls = ''
//                     for(let i = add_dates.date; i <= date.date; i++){
//                         htmls += `
//                             <li>
//                                 <span data-day='${i}'>${date.year}-${date.month}-${i}:</span>
//                                 <input type="text" class="BFBFBF_inputStyle add_people_input">
//                                 <i class='iconfont icon-cha'></i>
//                             </li>
//                         `
//                     }
//                     $('#add_workTime_list').html(htmls)
//                     let len = $('#add_workTime_list').children('li').length
//                     $('#add_people').find('[add_name="add_workTime"]').val(len*8)
//                 }
//             }
//         }else{
//             $('#yz_modal').html('请先选择开始时间！')
//             $('#yz_modal').addClass('active')
//             tipShow()
//             $('#add_workTime_list').html('')
//             $('#end_time_add').val('')
//             $('#add_people').find('[add_name="add_workTime"]').val('0')
//         }
//     }
// })
// /*编辑时*/
// laydate.render({
//     elem: '#start_time_edit', //指定元素
//     theme: '#2881C1',
//     done: function(value, date, endDate){
//         // let val = value
//         // let year = date.year
//         // let mon = date.month
//         // let day = date.date
//         edit_dates = date
//         // $('#end_time_edit').removeAttr('disabled')
//         $('#edit_workTime_list').html('')
//         $('#end_time_add').val('')
//         $('#edit_people').find('[add_name="edit_workTime"]').val('0')
//     },
//     change:function(value, date, endDate){
//         $('#edit_workTime_list').html('')
//         $('#end_time_edit').val('')
//         $('#edit_people').find('[add_name="edit_workTime"]').val('0')
//     }
// });

// laydate.render({
//     elem: '#end_time_edit', //指定元素
//     theme: '#2881C1',
//     done: function(value, date, endDate){
//         if(edit_dates!=''){
//             if(date.month!=edit_dates.month){
//                 $('#yz_modal').html('不能选择其他月份！')
//                 $('#yz_modal').addClass('active')
//                 tipShow()
//                 $('#edit_workTime_list').html('')
//                 $('#end_time_edit').val('')
//                 $('#edit_people').find('[add_name="edit_workTime"]').val('0')
//             }else if(date.year!=edit_dates.year){
//                 $('#yz_modal').html('不能跨年选择！')
//                 $('#yz_modal').addClass('active')
//                 tipShow()
//                 $('#edit_workTime_list').html('')
//                 $('#end_time_edit').val('')
//                 $('#edit_people').find('[add_name="edit_workTime"]').val('0')
//             }else{
//                 if(date.date<edit_dates.date){
//                     $('#yz_modal').html('结束日期不能小于开始日期')
//                     $('#yz_modal').addClass('active')
//                     tipShow()
//                     $('#edit_workTime_list').html('')
//                     $('#end_time_edit').val('')
//                     $('#edit_people').find('[add_name="edit_workTime"]').val('0')
//                 }else{
//                     let htmls = ''
//                     for(let i = edit_dates.date; i <= date.date; i++){
//                         htmls += `
//                             <li>
//                                 <span data-day='${i}'>${date.year}-${date.month}-${i}:</span>
//                                 <input type="text" class="BFBFBF_inputStyle add_people_input">
//                                 <i class='iconfont icon-cha'></i>
//                             </li>
//                         `
//                     }
//                     $('#edit_workTime_list').html(htmls)
//                     let len = $('#edit_workTime_list').children('li').length
//                     $('#edit_people').find('[add_name="edit_workTime"]').val(len*8)
//                 }
//             }
//         }else{
//             $('#yz_modal').html('请先选择开始时间！')
//             $('#yz_modal').addClass('active')
//             tipShow()
//             $('#edit_workTime_list').html('')
//             $('#end_time_edit').val('')
//             $('#edit_people').find('[add_name="edit_workTime"]').val('0')
//         }
//     }
// })
        //     laydate.render({
        //         elem: '#start_time_edit', //指定元素
        //         theme: '#2881C1',
        //         type: 'month',
        //         done: function(value, date, endDate){
        //             let val = value
        //             let mon = date.month
        //             //选择工时
        //             laydate.render({
        //                 elem: '#edit_choose_workTime', //指定元素
        //                 theme: '#2881C1',
        //                 value: val+'-01',
        //                 done: function(value, date, endDate){
        //                     // console.log(date)
        //                     let htmls = `
        //                         <li>
        //                             <span data-day='${date.date}'>${value}:</span>
        //                             <input type="text" class="BFBFBF_inputStyle add_people_input">
        //                             <i class='iconfont icon-cha'></i>
        //                         </li>
        //                     `
                            
        //                     $('#edit_workTime_list').append(htmls)
        //                     let len = $('#edit_workTime_list').children('li').length
        //                     $('#edit_people').find('[add_name="edit_workTime"]').val(len*8)
        //                 },
        //                 change:function(value, date, endDate){
        //                     if(date.month!=mon){
        //                         $('#yz_modal').html('不能选择其他月份！')
        //                         $('#yz_modal').addClass('active')
        //                         tipShow()
        //                         $('#edit_workTime_list').html('')
        //                         $('#edit_people').find('[add_name="edit_workTime"]').val('0')
        //                     }
                            
        //                 }
        //             })

        //         },
        //         change:function(value, date, endDate){
        //             $('#edit_workTime_list').html('')
        //             $('#edit_people').find('[add_name="edit_workTime"]').val('0')
        //         }
        //     });
        // })

$('#add_workTime_list').on('click','i',function(){
    $(this).closest('li').remove()
    let work = $('#add_people').find('[add_name="add_workTime"]').val()
    let hours = $(this).siblings('.input_work_hours').val()
    $('#add_people').find('[add_name="add_workTime"]').val(work-hours)
})
$('#edit_workTime_list').on('click','i',function(){
    $(this).closest('li').remove()
    let work = $('#edit_people').find('[add_name="edit_workTime"]').val()
    let hours = $(this).siblings('.input_work_hours').val()
    $('#edit_people').find('[add_name="edit_workTime"]').val(work-hours)
})

// 弹出来的小框框
    function tipShow(){
        window.tipBox = setTimeout(function(){
            // $('#yz_modal').removeClass('active')
            // $('#yz_modal').addClass('fadeOut')
            $('#yz_modal').removeClass('active')
            clearTimeout(tipBox)
        },2000)
    }

   }) 
    </script>
</body>
</html>